﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Linq.Expressions;
using System.Text;
using System.Web;
using System.Web.Mvc;

namespace BarManager.UI.Web.HtmlHelpers
{
    public static class CheckBoxHelper
    {
        public static MvcHtmlString CheckBoxCustom(this HtmlHelper html, string showName, string name, bool value)
        {
            // <button type="button" class="btn btn-primary">Left</button>

            TagBuilder buttonTag = new TagBuilder("button");
            buttonTag.MergeAttribute("type", "button");
            buttonTag.AddCssClass("btn checkboxtoggle");
            buttonTag.MergeAttribute("name", name);
            buttonTag.SetInnerText(showName);

            if (value) buttonTag.AddCssClass("active");

            return MvcHtmlString.Create(buttonTag.ToString());
        }
    }
}